package org.example.factory.factory_method;


/**
 * @Author KEKE
 * @Date 2024/7/1 9:30
 * @Description 咖啡店
 * @Version 1.0
 */
public class CoffeeStore {

    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        //加配料
        coffee.addmilk();
        coffee.addsugar();
        return coffee;
    }

}
